package com.lute.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

@Entity
public class CompanyCategory {

	private int id_company_category;
	private String name;
	private Set<ClientCategory> clientCategories = new HashSet<ClientCategory>();
//	private List<Notepad_entries> notepadEntries = 
//			new ArrayList<Notepad_entries>();
//	private List<Employee_entries> employeeEntries = new ArrayList<Employee_entries>();
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id_company_category")
	public int getId_company_category() {
		return id_company_category;
	}
	public void setId_company_category(int id_company_category) {
		this.id_company_category = id_company_category;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@ManyToMany(cascade=CascadeType.ALL)
	@JoinTable(name="companycategory_clientcategory",
				joinColumns={@JoinColumn(name="id_company_category")},
				inverseJoinColumns={@JoinColumn(name="id_client_category")})
	public Set<ClientCategory> getClientCategories() {
		return clientCategories;
	}
	public void setClientCategories(Set<ClientCategory> clientCategories) {
		this.clientCategories = clientCategories;
	}

//	@OneToMany(targetEntity=Notepad_entries.class, mappedBy="companyCategory",
//			cascade=CascadeType.ALL, fetch=FetchType.LAZY)
//	public List<Notepad_entries> getNotepadEntries() {
//		return notepadEntries;
//	}
//	public void setNotepadEntries(List<Notepad_entries> notepadEntries) {
//		this.notepadEntries = notepadEntries;
//	}
//	
//	@OneToMany(targetEntity=Employee_entries.class, mappedBy="companyCategory",
//			cascade=CascadeType.ALL, fetch=FetchType.LAZY)
//	public List<Employee_entries> getEmployeeEntries() {
//		return employeeEntries;
//	}
//	public void setEmployeeEntries(List<Employee_entries> employeeEntries) {
//		this.employeeEntries = employeeEntries;
//	}
}
